Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create a GitHub data source using the new Project structure #77

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

tarkatronic
Copy link
Contributor

This is a follow-up to #75, and huge step toward enabling #43.

This converts the GitHub querying code to use the new ProjectCollection/Project/Finding data structures.

I also included commented-out code in internal/scan.go that I used to prove this out. That is ultimately what will lead to the full enablement of #43.

@tarkatronic tarkatronic requested a review from a team as a code owner August 2, 2023 20:30
@tarkatronic
Copy link
Contributor Author

Note: I did not yet write any tests for this, and I'm sure codecov is going to complain about that. I will get to that, but I wanted to get this code up since it's large and exciting!

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #77 (8ed98b9) into main (4ccefe9) will increase coverage by 2.98%.
The diff coverage is 71.96%.

@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   56.22%   59.20%   +2.98%     
==========================================
  Files          14       15       +1     
  Lines         635      733      +98     
==========================================
+ Hits          357      434      +77     
- Misses        272      289      +17     
- Partials        6       10       +4     
Flag Coverage Δ
unittests 59.20% <71.96%> (+2.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
api/github.go 0.00% <0.00%> (ø)
internal/scan.go 0.00% <0.00%> (ø)
querying/github.go 77.55% <77.55%> (ø)
querying/project.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tarkatronic tarkatronic added this to the Version 1.0 milestone Aug 2, 2023
@tarkatronic tarkatronic added Data Sources Issues related to collection of security alerts Data Source: Dependabot labels Aug 2, 2023
Copy link
Contributor

@JoseAngel1196 JoseAngel1196 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niceee!

ghOrgLogin := env.GithubOrg
slackToken := env.SlackAuthToken
/****
* NOTE: This is working code at the moment, but will remain commented out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

)

func TestCollectFindingsSingleProjectSingleFinding(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so cool!

@tarkatronic tarkatronic merged commit 09f73d4 into main Aug 4, 2023
30 checks passed
@tarkatronic tarkatronic deleted the feat/github-datasource branch August 4, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Source: Dependabot Data Sources Issues related to collection of security alerts
Projects
Development

Successfully merging this pull request may close these issues.

2 participants